package com.lyz.myself.controller;

import com.lyz.myself.config.utils.Result;
import com.lyz.myself.config.utils.base.CodeMsg;
import com.lyz.myself.pojo.Po.CustomerFocus;
import com.lyz.myself.service.CustomerFocusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: myself
 * @Date: 2019/1/17 11:37
 * @Author: Mr.Deng
 * @Description:
 */
@Api(description="关注客户")
@RestController
@RequestMapping("/customerFocusController")
public class CustomerFocusController {

    @Autowired
    private CustomerFocusService customerFocusService;

    @ApiOperation("关注客户")
    @RequiresAuthentication
    @RequestMapping(path = "/insertFocus", method = RequestMethod.POST)
    public Result insertFocus(String customer_id) {
        if(customer_id!=null){
           boolean insertFocus =  customerFocusService.insertFocus(customer_id);
            if(insertFocus==true){
                return Result.success("关注成功！");
            }else{
                return Result.error(CodeMsg.ERROR,"关注失败！");
            }
        }else{
            return Result.error(CodeMsg.ERROR,"请输入要关注客户的id！");
        }

    }
}
